set(PYBIND_DEPS pybind python)
if (NOT LITE_ON_TINY_PUBLISH)
   set(PYBIND_DEPS ${PYBIND_DEPS} ${full_lib_DEPS} paddle_api_full opt_base fbs_headers)
endif()

if(WIN32)
   lite_cc_library(lite_pybind SHARED SRCS pybind.cc DEPS ${PYBIND_DEPS} ${external_libs_DEPS})
   get_property (os_dependency_modules GLOBAL PROPERTY OS_DEPENDENCY_MODULES)
   target_link_libraries(lite_pybind ${os_dependency_modules})
else()
   lite_cc_library(lite_pybind SHARED SRCS pybind.cc DEPS ${PYBIND_DEPS} ${external_libs_DEPS})
endif(WIN32)

if (WITH_XBYAK)
   add_dependencies(lite_pybind extern_xbyak)
endif()

if (LITE_ON_TINY_PUBLISH)
   set_target_properties(lite_pybind PROPERTIES COMPILE_FLAGS "-flto -fdata-sections")
endif()

if(WITH_AVX AND AVX_FOUND)
   if(WIN32)
      set_target_properties(lite_pybind PROPERTIES COMPILE_FLAGS "/arch:AVX2 /DAVX2 /fp:strict")
   else()
      set_target_properties(lite_pybind PROPERTIES COMPILE_FLAGS "-mfma -mf16c -mavx2")
   endif()
endif()
